﻿-- version: 25.11.1314
-- 日期/时间翻译器
-- Generate by imeasy: https://gitee.com/zelde/imeasy

local function fn(input, seg, env)
	-- Candidate(type, start, end, text, comment)
	if (input == 'od' or input == "date") then
		yield(Candidate("date", seg.start, seg._end, os.date("%Y-%m-%d"), "日期"))
		yield(Candidate("date", seg.start, seg._end, os.date("%Y年%m月%d日"), "日期"))
	elseif (input == "time" or input == 'ot') then
		yield(Candidate("time", seg.start, seg._end, os.date("%H:%M:%S"), "时间"))
	elseif (input == "odt" or input == "dtime") then
		yield(Candidate("dtime", seg.start, seg._end, os.date("%Y-%m-%d %H:%M:%S"), "日期时间"))
		yield(Candidate("dtime", seg.start, seg._end, os.date("%Y-%m-%dT%H:%M:%S"), "日期时间"))
	end
end

return fn
